package com.vmj.instructions.stack;

import com.vmj.instructions.base.NoOperandsInstruction;
import com.vmj.rtda.Frame;
import com.vmj.rtda.OperandStack;
import com.vmj.rtda.Slot;

/**
 * Created by yangshoujun on 2017/8/19 上午12:41.
 */
public class Dup extends NoOperandsInstruction {

    @Override
    public void execute(Frame frame) {
        OperandStack stack = frame.getOperandStack();
        Slot slot = stack.popSlot();
        stack.pushSlot(slot);
        stack.pushSlot(slot);
    }
}

